'''
Created on Apr 23, 2011

@author: Dima
'''
import bingapi

N = 720000000L

#This Function returns number of results of keyword 
#Using Bing Search Engine               
def bingSearchResults(keyword):
        searchval= keyword
        appId = '722A2CD216180D27F3F09631E65DE629692AC3C5'
        bing = bingapi.Bing(appId)  
        tempJson = bing.do_web_search(searchval)
        if (len(tempJson['SearchResponse']['Web'])==2):
            return 0  
        totNum = tempJson['SearchResponse']['Web']['Total']
        return long(totNum)  



